package Games.PumpGame.Menus
{
	import flash.text.TextField;
	import flash.text.TextFormat;
	import Framework.BaseEventHandler;
	import Framework.GuiElements.Button;
	import Framework.IntroScreens.TextScreen;
	import Games.PumpGame.PumpGame;
	
	/**
	 * ...
	 * @author Menno
	 */
	public class IntroText extends TextScreen
	{
		private var _eventHandeler:BaseEventHandler;
		
		public function IntroText(urlString:String, eventHandeler:BaseEventHandler) 
		{
			super(urlString);
			_eventHandeler = eventHandeler;			
		}
		
		override protected function displayText():void 
		{
			var textFormat:TextFormat = new TextFormat();
			textFormat.leading = -5;
			
			/**
			 * Maak addText functie van.
			 */
			var introField:TextField = new TextField();
			introField.text = texts[0];
			introField.x = 10;
			introField.y = 10;
			introField.width = introField.textWidth + 20;
			introField.height = 300
			introField.selectable = false;
			introField.setTextFormat(textFormat);
			addChild(introField);
			
			var explainField:TextField = new TextField();
			explainField.text = texts[1];
			explainField.x = 100;
			explainField.y = 100;
			explainField.width = explainField.textWidth + 20;
			explainField.height = 50
			introField.selectable = false;
			introField.setTextFormat(textFormat);
			addChild(explainField);
			
			//addButton("Speel", 60, 25 , 300, 300).addButtonListener("START", _eventHandeler);
			
			var button:Button = new Button("Speel", 60, 25 , 300, 300);			
			button.addButtonListener("START", _eventHandeler);
			this.addChild(button);
		}
		
	}
	
}